<admintpl file="header" />
<style type="text/css">
.pic-list li {
	margin-bottom: 5px;
}
.num{
	height:25px;
	-moz-border-radius: 12.5px; 
	-webkit-border-radius: 12.5px;	
	border-radius: 12.5px;
}
.btnx{
	background:#fff;
	color:#233140;
	border:1px solid #233140;
}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="">会员详情</a></li>	
		</ul>
		<input type="hidden" name="id" value="{$id}">
			<div class="row-fluid">
				<div class="span9">
				<php>$sex = array("1"=>"男","2"=>"女","3"=>"保密");</php>
					<table class="table">
						<tr>
						<th width="80">头像:</th>
							<td>
								<span><img src="{$data.avatar}" width="100" height="100"></span>
							</td>
						</tr>
						<tr>
						<th width="80">用户名:</th>

							<td>
								<input id="userid" type="hidden" value="{$data.userid}">
								<span>{$data.accounts}</span>
							</td>
						</tr>
						<tr>
						<th width="80">等级:</th>
							<td>
								<span>
									<?php if($data['score'] < '10'){echo 'VIP1';}
                                  elseif('10' <= $data['score'] && $data['score'] < '200'){echo 'VIP2';}
                                  elseif('200' <= $data['score'] && $data['score'] < '1000'){echo 'VIP3';}
                                  elseif('1000' <= $data['score'] && $data['score'] < '10000'){echo 'VIP4';}
                                  elseif('10000' <= $data['score'] && $data['score'] < '50000'){echo 'VIP5';}
                                  elseif('50000' <= $data['score'] && $data['score'] < '250000'){echo 'VIP6';}
                                  elseif('250000' <= $data['score'] && $data['score'] < '1000000'){echo 'VIP7';}
                                  elseif('1000000' <= $data['score'] && $data['score'] < '5000000'){echo 'VIP8';}
                                  elseif('5000000' <= $data['score']){echo 'VIP9';}; ?>
								</span>
							</td>
						</tr>
						<tr>
						<th width="80">头衔:</th>
							<td>
								<span>农民</span>
							</td>
						</tr>
						<tr>
						<th width="80">昵称:</th>
							<td>
								<span>{$data.nickname}</span>
							</td>
						</tr>
						<tr>
						<tr>
						<th width="80">邮箱:</th>
							<td>
								<span>{$data.email}</span>
							</td>
						</tr>
						<tr>
						<th width="80">QQ:</th>
							<td>
								<span>{$data.qq}</span>
							</td>
						</tr>
						<tr>
						<th width="80">性别:</th>
							<td>
								<span><php>echo $sex[$data['sex']];</php></span>
							</td>
						</tr>
						<tr>
						<th width="80">生日:</th>
							<td>
								<span>{$data.birth}</span>
							</td>
						</tr>
						<th width="80">手机:</th>
						<td>
							<input data-v-4ba25880="" id="shoujihao"  type="text" value="{$data.mobile}">
						</td>
						</tr>
						<th width="80">银行信息:</th>
						<td>
	<!--1工商银行2建设银行3农业银行4民生银行5招商银行6交通银行7中国银行8邮政储蓄9中信银行10兴业银行11华夏银行12浦发银行13广发银行14平安银行15光大银行16农商银行-->
							<foreach name="card" item="v">
								<div class="tiaoBox">
                               所属银行<select style="width: 100px" name="yinhang" id="yinhang">
											<option  value="1" <?php if($v['bankid']=='1'){echo "selected";} ?>>工商银行</option>
											<option  value="2" <?php if($v['bankid']=='2'){echo "selected";} ?>>建设银行</option>
											<option  value="3" <?php if($v['bankid']=='3'){echo "selected";} ?>>农业银行</option>
											<option  value="4" <?php if($v['bankid']=='4'){echo "selected";} ?>>民生银行</option>
											<option  value="5" <?php if($v['bankid']=='5'){echo "selected";} ?>>招商银行</option>
											<option  value="6" <?php if($v['bankid']=='6'){echo "selected";} ?>>交通银行</option>
											<option  value="7" <?php if($v['bankid']=='7'){echo "selected";} ?>>中国银行</option>
											<option  value="8" <?php if($v['bankid']=='8'){echo "selected";} ?>>邮政储蓄</option>
											<option  value="9" <?php if($v['bankid']=='9'){echo "selected";} ?>>中信银行</option>
											<option  value="10" <?php if($v['bankid']=='10'){echo "selected";} ?>>兴业银行</option>
											<option  value="11" <?php if($v['bankid']=='11'){echo "selected";} ?>>华夏银行</option>
											<option  value="12" <?php if($v['bankid']=='12'){echo "selected";} ?>>浦发银行</option>
											<option  value="13" <?php if($v['bankid']=='13'){echo "selected";} ?>>广发银行</option>
											<option  value="14" <?php if($v['bankid']=='14'){echo "selected";} ?>>平安银行</option>
											<option  value="15" <?php if($v['bankid']=='15'){echo "selected";} ?>>光大银行</option>
											<option  value="16" <?php if($v['bankid']=='16'){echo "selected";} ?>>农商银行</option>
						                </select>
							   银行卡号<input data-v-4ba25880="" id="bank_number" name="bank_number"  type="text" value="{$v.card}">
								        <input type="button" data-id="{$v.id}"  class="btn  cbtn"  value="确认修改" style="margin-left: 20px;margin-top: -5px;background: #e95d4e">
									    <input type="button" data-id="{$v.id}"  class="btn  shanchu"  value="删除" style="margin-left: 20px;margin-top: -5px;">
								</div>
							</foreach>
						</td>
						</tr>
						<tr>
							<th width="80">安全问题一:</th>
							<td>
								<select id="question1" class="diyselect sb" style="width: 231px; height: 30px;">
									<option value="1" <?php if($answer[0]['qid']==1){echo 'selected';} ?>>您的小学班主任是谁？</option>
									<option value="2" <?php if($answer[0]['qid']==2){echo 'selected';} ?>>您的初中班主任是谁？</option>
									<option value="3" <?php if($answer[0]['qid']==3){echo 'selected';} ?>>您的高中班主任是谁？</option>
									<option value="4" <?php if($answer[0]['qid']==4){echo 'selected';} ?>>您最最喜欢的人是谁？</option>
									<option value="5" <?php if($answer[0]['qid']==5){echo 'selected';} ?>>您喜欢的宠物叫什么？</option>
									<option value="6" <?php if($answer[0]['qid']==6){echo 'selected';} ?>>您的出生地点在哪里？</option>
									<option value="7" <?php if($answer[0]['qid']==7){echo 'selected';} ?>>您配偶的姓名叫什么？</option>
									<option value="8" <?php if($answer[0]['qid']==8){echo 'selected';} ?>>您爷爷的姓名叫什么？</option>
									<option value="9" <?php if($answer[0]['qid']==9){echo 'selected';} ?>>您爸爸的姓名叫什么？</option>
									<option value="10" <?php if($answer[0]['qid']==10){echo 'selected';} ?>>您妈妈的姓名叫什么？</option>
								</select>
								<span data-v-4ba25880="" style="margin-left: 30px">答案一：</span>
								<input data-v-4ba25880="" id="answer1" id="yi" type="text" class="userInput" value="{$answer[0]['answer']}">
							</td>
						</tr>
						<tr>
							<th width="80">安全问题二:</th>
							<td>
								<select id="question2" class="diyselect sb" style="width: 231px; height: 30px;">
									<option value="1" <?php if($answer[1]['qid']==1){echo 'selected';} ?>>您的小学班主任是谁？</option>
									<option value="2" <?php if($answer[1]['qid']==2){echo 'selected';} ?>>您的初中班主任是谁？</option>
									<option value="3" <?php if($answer[1]['qid']==3){echo 'selected';} ?>>您的高中班主任是谁？</option>
									<option value="4" <?php if($answer[1]['qid']==4){echo 'selected';} ?>>您最最喜欢的人是谁？</option>
									<option value="5" <?php if($answer[1]['qid']==5){echo 'selected';} ?>>您喜欢的宠物叫什么？</option>
									<option value="6" <?php if($answer[1]['qid']==6){echo 'selected';} ?>>您的出生地点在哪里？</option>
									<option value="7" <?php if($answer[1]['qid']==7){echo 'selected';} ?>>您配偶的姓名叫什么？</option>
									<option value="8" <?php if($answer[1]['qid']==8){echo 'selected';} ?>>您爷爷的姓名叫什么？</option>
									<option value="9" <?php if($answer[1]['qid']==9){echo 'selected';} ?>>您爸爸的姓名叫什么？</option>
									<option value="10" <?php if($answer[1]['qid']==10){echo 'selected';} ?>>您妈妈的姓名叫什么？</option>
								</select>
								<span data-v-4ba25880="" style="margin-left: 30px">答案二：</span>
								<input data-v-4ba25880="" id="answer2" id="er"  type="text" class="userInput" value="{$answer[1]['answer']}">
							</td>
						</tr>
						<tr>
							<th width="80">安全问题三:</th>
							<td>
								<select id="question3" class="diyselect sb" style="width: 231px; height: 30px;">
									<option value="1" <?php if($answer[2]['qid']==1){echo 'selected';} ?>>您的小学班主任是谁？</option>
									<option value="2" <?php if($answer[2]['qid']==2){echo 'selected';} ?>>您的初中班主任是谁？</option>
									<option value="3" <?php if($answer[2]['qid']==3){echo 'selected';} ?>>您的高中班主任是谁？</option>
									<option value="4" <?php if($answer[2]['qid']==4){echo 'selected';} ?>>您最最喜欢的人是谁？</option>
									<option value="5" <?php if($answer[2]['qid']==5){echo 'selected';} ?>>您喜欢的宠物叫什么？</option>
									<option value="6" <?php if($answer[2]['qid']==6){echo 'selected';} ?>>您的出生地点在哪里？</option>
									<option value="7" <?php if($answer[2]['qid']==7){echo 'selected';} ?>>您配偶的姓名叫什么？</option>
									<option value="8" <?php if($answer[2]['qid']==8){echo 'selected';} ?>>您爷爷的姓名叫什么？</option>
									<option value="9" <?php if($answer[2]['qid']==9){echo 'selected';} ?>>您爸爸的姓名叫什么？</option>
									<option value="10" <?php if($answer[2]['qid']==10){echo 'selected';} ?>>您妈妈的姓名叫什么？</option>
								</select>
								<span data-v-4ba25880="" style="margin-left: 30px">答案三：</span>
								<input data-v-4ba25880="" id="answer3" id="san"  type="text" class="userInput" value="{$answer[2]['answer']}">
							</td>
						</tr>
						<tr>
							<th width="80">安全码:</th>
							<td>
								<input data-v-4ba25880="" id="anquanma"  type="text" value="{$data.insurepass}">
							</td>
						</tr>
						<tr>
							<th width="80">密码:</th>
							<td>
								<input data-v-4ba25880="" id="mima"  type="text" value="{$data.logonpass}">
							</td>
						</tr>
					</table>
					<a  data-v-98161034="" onclick="sav()" class="btn btn-primary" style="margin-left: 300px">保存</a>
					<form class="" method="post" action="{:U('Member/frozen')}">
						<input type="hidden" name="id" value="{$data.userid}">
						<php>if($data['frozen'] == 0){</php>
						<input type="hidden" name="type" value="1">
						<input type="submit" class="btn btn-primary" value="冻结" style="margin-top: -45px" />
						<php>}else{</php>
						<input type="hidden" name="type" value="0">
						<input type="submit" class="btn btn-primary" value="解冻" />
						<php>}</php>
					</form>

				</div>
			</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript">
		//编辑器路径定义
		var editorURL = GV.WEB_ROOT;
	</script>
	<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
	<script type="text/javascript">
	</script>
</body>
</html>

<script>
	function sav(){
		var uid = $("#userid").val();
        var shoujihao = $("#shoujihao").val();
		var question1 = $("#question1").val();
		var question2 = $("#question2").val();
		var question3 = $("#question3").val();
		var answer1 = $("#answer1").val();
		var answer2 = $("#answer2").val();
		var answer3 = $("#answer3").val();
		var anquanma = $("#anquanma").val();
		var mima = $("#mima").val();
		var bank = $("#bank[]").val();


		if (shoujihao == '') {
			alert("手机号不能为空");
			return false;
		}
		if (mima == '') {
			alert("密码不能为空");
			return false;
		}
		if (answer1 == '') {
			alert("答案一不能为空");
			return false;
		}
		if (question2 == question1) {
			alert("请选择其他密保问题进行验证");
			return false;
		}
		if (answer2 == '') {
			alert("答案二不能为空");
			return false;
		}
		if (question3 == question2 || question3 == question1) {
			alert("请选择其他密保问题进行验证");
			return false;
		}
		if (answer3 == '') {
			alert("答案三不能为空");
			return false;
		}

		$.ajax({
			type: "POST",
			url: "{:U('Member/yinsi')}",
			data: {'uid': uid,'shoujihao': shoujihao,'question1':question1,'question2':question2,'question3':question3,'answer1':answer1,'answer2':answer2,'answer3':answer3,'anquanma':anquanma,'mima':mima},
			success: function (dat) {
				alert("保存成功");
				window.location.href="";
			}
		});
	}

	$(".cbtn").click(function(){
		var card_id = $(this).data("id");
		var bank = $(this).siblings("select").find("option:selected").val();//获取银行
		var card = $(this).siblings("input[name='bank_number']").val();//获取银行卡号

		$.ajax({
			type: "POST",
			url: "{:U('Member/xiugai_ka')}",
			data: {'card_id': card_id,"bank":bank,"card":card},
			success: function (dat) {
				if(dat==1){
					alert("保存成功");
				}
				window.location.href="";
			}
		});
	})
	$(".shanchu").click(function(){
		var card_id = $(this).data("id");
        if(confirm("确认要删除么？")){
			$.ajax({
				type: "POST",
				url: "{:U('Member/shanchu_ka')}",
				data: {'card_id': card_id},
				success: function (dat) {
					if(dat==1){
						alert("删除成功");
					}
					window.location.href="";
				}
			});
		}

	})

</script>